package com.itheima.mp.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class User {

    @TableId(type = IdType.AUTO) //使用数据库自增
    private Long id;
    private String userName; //驼峰命名,则无需注解
    private String password;
    private String name;
    private Integer age;
    private String email;
    private LocalDateTime birthday;

    @TableField(fill = FieldFill.INSERT) //插入时自动补充
    private LocalDateTime createdTime;
}